import axios from "@/util/request"

export function findAllBlog(form) {
    return axios({
        url: 'blogs',
        method: 'GET',
        params: {
            ...form
        }
    })
}

export function findBlogById(id) {
    return axios({
        url: `blog?id=${id}`,
        method: 'GET'
    })
}


export function saveBlog(form) {
    return axios({
        url: 'blog',
        method: 'POST',
        data: {
            ...form
        }
    })
}

export function updateBlog(form) {
    return axios({
        url: 'blog',
        method: 'PUT',
        data: {
            ...form
        }
    })
}

export function deleteBlogById(id) {
    return axios({
        url: `blog?id=${id}`,
        method: 'DELETE'
    })
}
